package com.beacon.controller;

import com.beacon.model.Financial;
import com.beacon.model.Repayment;
import com.beacon.service.RepaymentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 编写者：魏乾聪
 * 编写时间：2019/05/22
 * 类模块描述：还款的查询及相关增删改查
 */
@RestController(value = "/Repayment")
public class RepaymentController {
    @Autowired
    private RepaymentService repaymentService;

    @RequestMapping(value = "/getRepayment")
    public String setRepaymentStr(String str){
        return "你输入的名字叫："+str;
    }

    /*跨域访问*/
    @CrossOrigin

    @RequestMapping(value = "/getR")
    public Repayment getR(Integer reid){
        System.out.println("输入的数据为："+reid);
        return repaymentService.selectByPrimaryKey(reid);
    }



    public void getLog(Repayment repayment){
        if(repayment != null){
            repaymentService.selectByPrimaryKey(repayment.getReid());
        }
    }

}